1. Field
Embodiments relate to the field of processors. In particular, embodiments relate to the field of multi-threaded processors.
2. Background Information
Multi-threaded and/or multi-core processors are commonplace today. They are used in various types of computing devices such as servers, desktops, laptops, netbooks, tablets, smartphones, and cell phones, to name just a few examples. It is currently expected that, at least for some processor segments, the trend to increasingly more threads and/or cores is going to continue into the future.
The multiple threads and/or cores generally help to improve performance by providing hardware parallelism which allows more instructions to be executed concurrently or in parallel. The multiple threads and/or cores have encouraged the development of multi-threaded or parallel processing software. For example, a multi-threaded application may include multiple threads that execute concurrently on different hardware threads and/or cores. In addition, stand-alone applications are often extended with plugins that open gateways to various services that provide even more software parallelism.
However, one challenge with such multi-threaded or parallel processing software is that it tends to be more difficult to debug as compared to single-threaded software. One factor in particular that contributes to the difficulty in debugging such software is the non-deterministic nature of the execution of such software. For example, the threads of a multi-threaded program may interleave differently from one execution of the program to the next. Such variance in the interleaving of the threads may cause variance into the ordering of the accesses by the threads to shared memory from one execution of the program to the next. For example, the threads may access the shared memory in one particular interleaved order one time the program is executed, but the threads may access the shared memory in a different interleaved order another time the program is executed.
Some types of bugs in particular may be difficult to analyze, debug, and fix, as a result of such non-deterministic execution behavior. For example, concurrency bugs may only occur under some but not all thread interleavings and/or shared memory access orderings. For example, a concurrency bug may occur one time a program is executed with a particular thread interleaving (and/or shared memory access ordering), but the concurrency bug may not occur another time the program is executed with a different thread interleaving (and/or different shared memory access ordering). This may tend to make it difficult for a software developer, software debugger, or the like, to know, let alone reproduce, the particular thread interleaving and/or shared memory access ordering that resulted in the concurrency bug.
For these reasons, it may tend to take more time to debug multi-threaded or parallel processing software as compared to single-threaded software. This may tend to lead to higher software development costs and/or potential delays in bringing the multi-threaded or parallel processing software to market. Because of such factors, some software developers tend to favor single-threaded software (e.g., where concurrency bugs are easier to debug) over multi-threaded software. However, without multi-threaded or parallel processing software the hardware parallelism of the multi-thread and/or multi-cores cannot be fully exploited to its full potential.